//
//  HMHomeFootView.m
//  G05爱鲜蜂
//
//  Created by 源 何 on 16/10/19.
//  Copyright © 2016年 何源. All rights reserved.
//

#import "HMHomeFootView.h"
#define kMargin 10

static NSString *reuseIdentifier = @"HMHomeFootViewID";

@interface HMHomeFootView ()<UICollectionViewDelegate,UICollectionViewDataSource>

@property (nonatomic, strong) UICollectionViewFlowLayout *flowLayout;

@property (nonatomic, strong) UICollectionView *footCollectionView;

@end

@implementation HMHomeFootView

#pragma mark
#pragma mark -- 懒加载
- (UICollectionViewFlowLayout *)flowLayout{
    if (nil == _flowLayout) {
        _flowLayout = [[UICollectionViewFlowLayout alloc] init];
    }
    return _flowLayout;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    self.flowLayout = [[UICollectionViewFlowLayout alloc] init];
    CGFloat flowLayW = ([UIScreen mainScreen].bounds.size.width - 3) / 2;
    self.flowLayout.itemSize = CGSizeMake(flowLayW, 100);
    
    self.flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;

    self.flowLayout.minimumLineSpacing = 0;
    self.flowLayout.minimumInteritemSpacing = 0;
    
    self.footCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:self.flowLayout];
    [self.footCollectionView registerClass:[UICollectionView class] forCellWithReuseIdentifier:reuseIdentifier];
    
    [self addSubview:self.footCollectionView];
    self.footCollectionView.bounces = NO;
    self.footCollectionView.pagingEnabled = YES;
    
    [self.footCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
    }];
    self.footCollectionView.delegate = self;
    self.footCollectionView.dataSource = self;
}

#pragma mark
#pragma mark -- delegate dataSource
//- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
//    
//}

//- num

@end
